package com.shockweb.common.utils;

import java.util.Random;

/**
 * 数字工具类
 * Created by wzl on 2017/6/1.
 */
public class NumberUtil {

    /**
     * 带有位数的随机数生成方法
     *
     * @param number 位数
     * @return String
     */
    public static String getRandomNumber(int number) {
        if (number < 1) {
            return "0";
        }
        String back = "";
        Random random = new Random();
        for (int i = 0; i < number; i++) {
            back += random.nextInt(10);
        }
        return back;
    }
}
